﻿using System;

namespace VASJ.Provider
{
    public class AcpInetPermission
    {
        /// <summary>
        /// SetPermissionForUser
        /// </summary>
        /// <param name="UserName"></param>
        /// <returns></returns>
        public static bool SetPermissionForUser(string userName, int projectId, string permissionName)
        {
            return (new AcpInetPermisionProvider()).SetPermissionForUser(userName, projectId, permissionName);
        }

        /// <summary>
        /// SetPermissionForUser
        /// </summary>
        /// <param name="userName"></param>
        /// <param name="projectId"></param>
        /// <param name="permissionName"></param>
        /// <returns></returns>
        public static bool SetPermissionForUser(string userName, int projectId, string[] permissionName)
        {
            return (new AcpInetPermisionProvider()).SetPermissionForUser(userName, projectId, permissionName);
        }

        /// <summary>
        /// SynchPermissionType
        /// </summary>
        /// <param name="UserName"></param>
        /// <returns></returns>
        public static bool SynchPermissionType(string[] permissionName)
        {
            return (new AcpInetPermisionProvider()).SynchPermissionType(permissionName);
        }

        /// <summary>
        /// GrantPermissionForRole
        /// </summary>
        /// <param name="roleName"></param>
        /// <param name="permissionName"></param>
        /// <param name="grant"></param>
        public static bool GrantPermissionForRole(string roleName, string permissionName, bool grant)
        {
            return (new AcpInetPermisionProvider()).GrantPermissionForRole(roleName, permissionName, grant);
        }

        /// <summary>
        /// RemovePermissionForTarget
        /// </summary>
        /// <param name="userName"></param>
        /// <param name="projectID"></param>
        /// <param name="permissionName"></param>
        public static bool RemovePermissionForTarget(string userName, int projectID, string permissionName)
        {
            return (new AcpInetPermisionProvider()).RemovePermissionForTarget(userName, projectID, permissionName);
        }

        /// <summary>
        /// RemovePermissionForTarget
        /// </summary>
        /// <param name="userName"></param>
        /// <param name="projectID"></param>
        /// <param name="permissionName"></param>
        public static bool RemovePermissionForTarget(string userName, int projectID, string[] permissionName)
        {
            return (new AcpInetPermisionProvider()).RemovePermissionForTarget(userName, projectID, permissionName);
        }

        /// <summary>
        /// RemovePermissionForRole
        /// </summary>
        /// <param name="roleName"></param>
        public static bool RemovePermissionForRole(string roleName)
        {
            return (new AcpInetPermisionProvider()).RemovePermissionForRole(roleName);
        }

        /// <summary>
        /// RemovePermissionForRole
        /// </summary>
        /// <param name="roleName"></param>
        public static bool RemovePermissionForUser(string userName)
        {
            return (new AcpInetPermisionProvider()).RemovePermissionForUser(userName);
        }

        /// <summary>
        /// IsGrantedUser
        /// </summary>
        /// <param name="userName"></param>
        /// <param name="projectID"></param>
        /// <param name="permissionName"></param>
        /// <returns></returns>
        public static bool IsGrantedUser(string userName, int projectID, string permissionName)
        {
            return (new AcpInetPermisionProvider()).IsGrantedUser(userName, projectID, permissionName);
        }

        /// <summary>
        /// IsGrantedUser
        /// </summary>
        /// <param name="userName"></param>
        /// <param name="projectID"></param>
        /// <param name="permissionName"></param>
        /// <returns></returns>
        public static bool IsGrantedUser(string userName, int projectID, string[] permissionName)
        {
            return (new AcpInetPermisionProvider()).IsGrantedUser(userName, projectID, permissionName);
        }

        /// <summary>
        /// GetGrantedPermission
        /// </summary>
        /// <param name="userName"></param>
        /// <param name="permissionName"></param>
        /// <returns></returns>
        public static int[] GetGrantedPermission(string userName, string permissionName)
        {
            return (new AcpInetPermisionProvider()).GetGrantedPermission(userName, permissionName);
        }

        /// <summary>
        /// GetGrantedPermission
        /// </summary>
        /// <param name="userName"></param>
        /// <param name="permissionName"></param>
        /// <returns></returns>
        public static int[] GetGrantedPermission(string userName, string[] permissionName)
        {
            return (new AcpInetPermisionProvider()).GetGrantedPermission(userName, permissionName);
        }

        /// <summary>
        /// GetGratedUser2
        /// </summary>
        /// <param name="projectID"></param>
        /// <param name="permissionName"></param>
        /// <returns>the userid list</returns>
        public static Guid[] GetGratedUserID(int projectID, string permissionName)
        {
            return (new AcpInetPermisionProvider()).GetGratedUser2(projectID, permissionName);
        }

        /// <summary>
        /// GetGratedUser2
        /// </summary>
        /// <param name="projectID"></param>
        /// <param name="permissionName"></param>
        /// <returns>the userid list</returns>
        public static Guid[] GetGratedUserID(int projectID, string[] permissionName)
        {
            return (new AcpInetPermisionProvider()).GetGratedUser2(projectID, permissionName);
        }

        /// <summary>
        /// GetGratedUser
        /// </summary>
        /// <param name="projectID"></param>
        /// <param name="permissionName"></param>
        /// <returns>the username list</returns>
        public static string[] GetGratedUserName(int projectID, string permissionName)
        {
            return (new AcpInetPermisionProvider()).GetGratedUser(projectID, permissionName);
        }

        /// <summary>
        /// GetGratedUser
        /// </summary>
        /// <param name="projectID"></param>
        /// <param name="permissionName"></param>
        /// <returns>the username list</returns>
        public static string[] GetGratedUserName(int projectID, string[] permissionName)
        {
            return (new AcpInetPermisionProvider()).GetGratedUser(projectID, permissionName);
        }

        /// <summary>
        /// GetRoleOfPermission
        /// </summary>
        /// <param name="permissionName"></param>
        /// <returns></returns>
        public static string[] GetRoleOfPermission(string permissionName)
        {
            return (new AcpInetPermisionProvider()).GetRoleOfPermission(permissionName);
        }

        /// <summary>
        /// GetRoleOfPermission
        /// </summary>
        /// <param name="permissionName"></param>
        /// <returns></returns>
        public static string[] GetRoleOfPermission(string[] permissionName)
        {
            return (new AcpInetPermisionProvider()).GetRoleOfPermission(permissionName);
        }

        /// <summary>
        /// IsUserHasRolePermission
        /// </summary>
        /// <param name="userName"></param>
        /// <param name="Role"></param>
        /// <param name="permissionName"></param>
        /// <returns></returns>
        public static bool IsUserHasRolePermission(string userName, string permissionName)
        {
            return (new AcpInetPermisionProvider()).IsUserHasRolePermission(userName, null, permissionName);
        }

        /// <summary>
        /// IsUserHasRolePermission
        /// </summary>
        /// <param name="userName"></param>
        /// <param name="Role"></param>
        /// <param name="permissionName"></param>
        /// <returns></returns>
        public static bool IsUserHasRolePermission(string userName, string[] permissionName)
        {
            return (new AcpInetPermisionProvider()).IsUserHasRolePermission(userName, null, permissionName);
        }

        /// <summary>
        /// GetRolePermission
        /// </summary>
        /// <param name="roleName"></param>
        /// <returns></returns>
        public static string[] GetRolePermission(string roleName)
        {
            return (new AcpInetPermisionProvider()).GetRolePermission(roleName);
        }

        /// <summary>
        /// GetRolePermission
        /// </summary>
        /// <param name="roleName"></param>
        /// <returns></returns>
        public static string[] GetRolePermission(string[] roleName)
        {
            return (new AcpInetPermisionProvider()).GetRolePermission(roleName);
        }

        /// <summary>
        /// GetRolePermissionsForUser
        /// </summary>
        /// <param name="userName"></param>
        /// <returns></returns>
        public static string[] GetRolePermissionsForUser(string userName)
        {
            return (new AcpInetPermisionProvider()).GetRolePermissionsForUser(userName);
        }
    }
}